from ..helpers import article
from ._helpers import TetrahedronScheme, concat, s22, s31, s211, s1111

citation = article(
    authors=["Linbo Zhang", "Tao Cui", "Hui Liu"],
    title="A set of symmetric quadrature rules on triangles and tetrahedra",
    journal="Journal of Computational Mathematics",
    volume="27",
    number="1",
    month="jan",
    year="2009",
    pages="89-96",
    url="https://www.jstor.org/stable/43693493",
)


def zhang_cui_liu_1():
    degree = 8
    weights, points = concat(
        s31(
            [
                0.0063971477799023213214514203351730,
                0.0396754230703899012650713295393895,
            ],
            [
                0.0401904480209661724881611584798178,
                0.3144878006980963137841605626971483,
            ],
            [
                0.0243079755047703211748691087719226,
                0.1019866930627033000000000000000000,
            ],
            [
                0.0548588924136974404669241239903914,
                0.1842036969491915122759464173489092,
            ],
        ),
        s22(
            [0.0357196122340991824649509689966176, 0.0634362877545398924051412387018983]
        ),
        s211(
            [
                0.0071831906978525394094511052198038,
                0.0216901620677280048026624826249302,
                0.7199319220394659358894349533527348,
            ],
            [
                0.0163721819453191175409381397561191,
                0.2044800806367957142413355748727453,
                0.5805771901288092241753981713906204,
            ],
        ),
    )
    return TetrahedronScheme("Zhang-Cui-Liu 1", weights, points, degree, citation)


def zhang_cui_liu_2():
    degree = 14
    weights, points = concat(
        s31(
            [
                0.0040651136652707670436208836835636,
                0.3272533625238485639093096692685289,
            ],
            [
                0.0022145385334455781437599569500071,
                0.0447613044666850808837942096478842,
            ],
            [
                0.0058134382678884505495373338821455,
                0.0861403311024363536537208740298857,
            ],
            [
                0.0196255433858357215975623333961715,
                0.2087626425004322968265357083976176,
            ],
            [
                0.0003875737905908214364538721248394,
                0.0141049738029209600635879152102928,
            ],
        ),
        s211(
            [
                0.0116429719721770369855213401005552,
                0.1021653241807768123476692526982584,
                0.5739463675943338202814002893460107,
            ],
            [
                0.0052890429882817131317736883052856,
                0.4075700516600107157213295651301783,
                0.0922278701390201300000000000000000,
            ],
            [
                0.0018310854163600559376697823488069,
                0.0156640007402803585557586709578084,
                0.7012810959589440327139967673208426,
            ],
            [
                0.0082496473772146452067449669173660,
                0.2254963562525029053780724154201103,
                0.4769063974420887115860583354107011,
            ],
        ),
        s1111(
            [
                0.0030099245347082451376888748208987,
                0.3905984281281458000000000000000000,
                0.2013590544123922168123077327235092,
                0.0161122880710300298578026931548371,
            ],
            [
                0.0008047165617367534636261808760312,
                0.1061350679989021455556139029848079,
                0.0327358186817269284944004077912660,
                0.0035979076537271666907971523385925,
            ],
            [
                0.0029850412588493071187655692883922,
                0.5636383731697743896896816630648502,
                0.2302920722300657454502526874135652,
                0.1907199341743551862712487790637898,
            ],
            [
                0.0056896002418760766963361477811973,
                0.3676255095325860844092206775991167,
                0.2078851380230044950717102125250735,
                0.3312104885193449000000000000000000,
            ],
            [
                0.0041590865878545715670013980182613,
                0.7192323689817295295023401840796991,
                0.1763279118019329762157993033636973,
                0.0207602362571310090754973440611644,
            ],
            [
                0.0007282389204572724356136429745654,
                0.5278249952152987298409240075817276,
                0.4372890892203418165526238760841918,
                0.0092201651856641949463177554949220,
            ],
            [
                0.0054326500769958248216242340651926,
                0.5483674544948190728994910505607746,
                0.3447815506171641228703671870920331,
                0.0867217283322215394629438740085828,
            ],
        ),
    )
    return TetrahedronScheme("Zhang-Cui-Liu 2", weights, points, degree, citation)
